package com.study.结构型模式.代理模式.静态代理;

//代理对象，静态代理
public class TeacherDaoProxy implements ITeacherDao{

    private ITeacherDao target;  //这是被代理类对象，通过接口来聚合

    TeacherDaoProxy(ITeacherDao target){
        this.target = target;
    }

    @Override
    public void teach() {
        System.out.println("代理开始...");
        target.teach();
        System.out.println("代理结束....");
    }
}
